package com.wxzz.elearing.file.api.server;

import com.wxzz.elearing.file.service.impl.ObsService;
import com.wxzz.elearning.common.dto.FeignDrawImageDto;
import com.wxzz.elearning.common.vo.ReturnVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/obs-api")
public class ObsApi {

    @Autowired
    private ObsService obsService;

    @RequestMapping(value = "/makePayImage", method = RequestMethod.POST)
    public ReturnVO<String> makePayImage(@RequestBody Map<String, String> map) {
        return obsService.makePayImage(map);
    }

    /**
     * 获得证书路径
     *
     * @param feignDrawImageDto
     * @return
     */
    @RequestMapping(value = "/getCredentialUrl", method = RequestMethod.POST)
    public String getCredentialUrl(@RequestBody FeignDrawImageDto feignDrawImageDto) {
        return obsService.getCredentialUrl(feignDrawImageDto);
    }

    /**
     * 生成活动二维码
     *
     * @param activityId
     * @return
     */
    @RequestMapping(value = "/makeActivityImage/{activityId}", method = RequestMethod.POST)
    public String makeActivityImage(@PathVariable Long activityId) {
        return obsService.makeActivityImage(activityId);
    }

}

